var o = require("../../utils/util.js");

Page({
    data: {},
    onLoad: function(o) {
        this.getCode();
    },
    onShow: function() {},
    login: function(n) {
        o.showLoading("正在登录..."), console.log("login -====="), console.log(n), o.buttonLogin(function() {
            o.hideLoading(), wx.navigateBack({
                delta: 1
            });
        }, function() {
            o.hideLoading();
        }, n.detail);
    },
    getCode: function() {
        wx.login({
            success: function(n) {
                var t = n.code;
                t && o.setStorage("code", t);
            }
        });
        var n = this;
        setTimeout(function() {
            n.getCode(n);
        }, 24e4);
    }
});